<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">

    <f:view contentType="text/html">
        <h:head>
            <f:facet name="first">
                <meta http-equiv="X-UA-Compatible" content="EmulateIE8" />
                <meta content='text/html; charset=UTF-8' http-equiv="Content-Type"/>
                <title>Agenda</title>

            </f:facet>
					
            <link type="text/css" rel="stylesheet" href="#{request.contextPath}/css/default.css" />
            <link type="text/css" rel="stylesheet" href="#{request.contextPath}/css/syntaxhighlighter/syntaxhighlighter.css" />

            <style type="text/css">
                .ui-layout-north {
                    z-index:20 !important;
                    overflow:visible !important;
                }

                .ui-layout-north .ui-layout-unit-content {
                    overflow:visible !important;
                }
            </style>
        </h:head>


        <h:body>

            <p:layout fullPage="true" >

                <p:layoutUnit id="top" position="north" size="50">
                <h:panelGrid columns="3">
                	<h:panelGrid columns="2">
                		<p:commandButton icon="ui-icon-home" style="width:5px; height:5px; margin-left:5px;" />
						<p:commandLink value="Início" action="#{projetoBean.consultarProjeto}" immediate="true" style="font-family:Arial Black; font-size:15px"/>
					</h:panelGrid>	
					<h:panelGrid columns="4" style="text-align:right; float:right">
                		<p:commandButton icon="ui-icon-person" style="width:5px; height:5px; margin-left:5px;" />
						<p:outputLabel value="Bem Vindo(a), #{projetoBean.usuarioLogado.nome}" style="font-family:Arial Black; font-size:15px"/> 
						<p:commandButton icon="ui-icon-pencil" style="width:5px; height:5px; margin-left:5px;" />
						<p:commandLink value="Editar" action="#{projetoBean.editarUsuarioLogado}"  immediate="true" style="font-family:Arial Black; font-size:15px"/>
					</h:panelGrid>
					<h:panelGrid columns="2" style="text-align:right; float:right">
                		<p:commandButton icon="ui-icon-extlink" style="width:5px; height:5px; margin-left:5px;" />
						<p:commandLink value="Logout" action="#{projetoBean.logout}" immediate="true" style="font-family:Arial Black; font-size:15px"/>
					</h:panelGrid>
					</h:panelGrid>	
                </p:layoutUnit>

               <p:layoutUnit id="left" position="west" size="300" resizable="true" closable="true" collapsible="true" header="Options" minSize="200">
                 <p:accordionPanel>

                        <p:tab title="Meus Projetos">

                            <h:outputText /> <br /> 
                            <p:commandLink value="Consultar Projeto" action="#{projetoBean.consultarProjeto}" style="font-size:15px;" immediate="true"/><br /> 
                            <h:dataTable id="idTabelaProjeto" value="#{projetoBean.listaProjeto}"  var="projeto" rowKey="#{projeto.idProjeto}" 
    			 						 selection="#{projetoBean.projetoSelect}" selectionMode="single" >  
  
       							<p:column headerText="Nome do Projeto">  
      								<p:commandLink value="#{projeto.nomeProjeto}" style="font-size:15px;" action="#{projetoBean.viewProjeto}" process="@this" immediate="true">
      									<f:setPropertyActionListener value="#{projeto}" target="#{projetoBean.projetoSelect}" />
      								</p:commandLink>
        						</p:column>  
  
    						</h:dataTable>

                        </p:tab>


                        <p:tab title="Usuario" rendered="#{projetoBean.renderedAdministrador()}">
							<p:commandLink value="Editar Usuário" action="#{projetoBean.consultarUsuario}"/>
                        </p:tab>
                    </p:accordionPanel>
                </p:layoutUnit>

                <p:layoutUnit id="center" position="center">
                    <h:form prependId="false">

						<ui:insert name="conteudo"></ui:insert>

                    </h:form>
                </p:layoutUnit>

            </p:layout>

        </h:body>

    </f:view>
</html>